package edu.zut.oop;

public class Phone {

    String name;
    String language;

    public Phone(){
//        this.language = "英文";
        this("英文");
    }

    public Phone(String language){
        this.language = language;
    }

    public Phone(String name,String language){
        //构造方法是可以调用的，只能是构造调用构造，必须在第一行
        this(language);
        this.name = name;
    }


    public void say() {
        System.out.println("name：" + name + ",语言：" + language);
    }


    public static void main(String[] args) {
        Phone phone = new Phone();
        phone.name = "小米";
        phone.say();

        Phone phone2 = new Phone("中文");
        phone2.name = "大米";
        phone2.say();

        Phone phone3 = new Phone("红米","中文");
        phone3.say();

    }

}
